//导入 vue-router 路由对象
import VueRouter from 'vue-router'
//导入组件
import Home from './components/Home.vue'
import Classes from './components/Classes.vue'
import Cart from './components/Cart.vue'
import Find from './components/Find.vue'
import Mine from './components/Mine.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import imagelist from './components/photo/imagelist.vue'
import imageinfo from './components/photo/imageinfo.vue'
import goodlist from './components/shop/goodlist.vue'
import goodinfo from './components/shop/goodinfo.vue'

var router = new VueRouter({
    routes:[
        {
            path:"/",
            redirect:"/home" //配置根路由，页面开始展示
        },
        {
            path:'/home',
            component:Home
        },
        {
            path:'/classes',
            component:Classes
        },
        {
            path:'/cart',
            component:Cart
        },
        {
            path:'/find',
            component:Find
        },
        {
            path:'/mine',
            component:Mine
        },
        {
            path:'/home/newslist',
            component:NewsList
        },
        {
            path:'/home/newsinfo/:id',
            component:NewsInfo
        },
        {
            path:'/home/imagelist',
            component:imagelist
        },
        {
            path:'/home/imageinfo/:id',
            component:imageinfo
        },
        {
            path:'/home/goodlist',
            component:goodlist
        },
        {
            path:'/home/goodinfo/:id',
            component:goodinfo,
            name:'goodinfo'
        },
    ]
});
//导出
export default router;
//当分离出router.js模块后，一定要把router路由对象暴漏出去